import request from '@/utils/request'

export default{
    // 添加课程
    addCourseInfo(courseInfo){
        return request({
            url:'/eduservice/course/addCourseAndDescription',
            method:'post',
            data:courseInfo
        })
    },
    // 获取教师列表
    getTeacherList(){
       return request({
            url:'eduservice/teacher/findALl',
            method:"get"
        })
    },
    // 获取课程
    getCourseInfo(courseId){
        return request({
             url:`eduservice/course/getCourseInfo/${courseId}`,
             method:"get"
         })
     },
    // 更新课程信息
    updateCourseInfo(courseInfo){
        return request({
             url:'eduservice/course/updateCourseInfo',
             method:"put",
             data:courseInfo
         })
    },
    // 获取发布课程信息
    getCoursePublish(courseId){
        return request({
            url:`eduservice/course/getCoursePublish/${courseId}`,
            method:'get'
        })
    },
    // 根据课程Id发布课程
    publishCourse(courseId){
        return request({
            url:`eduservice/course/publishCourse/${courseId}`,
            method:'put'
        })
    },
    // 获取所有课程
    getCourseList(page,size,courseQuery){
        return request({
            url:`eduservice/course/queryCourseCondition/${page}/${size}`,
            method:'post',
            data:courseQuery
        })
    },
    // 根据Id删除课程
    removeCourseById(courseId){
        return request({
            url:`eduservice/course/deleteCourse/${courseId}`,
            method:'delete'
        })
    }
}